<?php

class Zend_View_Helper_GetFenleiChild{
	
	static public $flidArray;
	
	public function getFenleiChild($tree,$flid){
  
		self::$flidArray=array();
		
		$tree->BFS(array($this,'visit'),$flid);
		
		return join(',',self::$flidArray);
		
	}
	
	public function visit($node){
		
		if(count($node['child'])==0){
			
			if($node['data']['flid']!=''){	
				
				self::$flidArray[]=$node['data']['flid'];
			
			}
			
		}
			
	}

}

